package doInterce.impl;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.FileUtil;
import doInterce.DoInterface;
import utils.YmlUtil;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * @Description: 移除已经添加的照片
 * @Author: syh
 * @Date: 2024/01/10/17:48
 */
public class DoRemoveC01Photo implements DoInterface {
    @Override
    public void doExecute() {
        Map<String, Object> ymlMap = YmlUtil.getYmlMap();
        String czLog = Convert.toStr(ymlMap.get("czLog")); //辞去公职的相关日志输出路径

        List<String> list = FileUtil.readLines(new File(czLog).getAbsolutePath() + File.separator + "copyFile.txt", "utf-8");
        for(String filePath : list){
            if(FileUtil.exist(filePath)){
                FileUtil.del(filePath);
            }
        }
    }
}
